<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- 当自定义属性没有被子组件的props接收 -->
      <!-- 那么这个属性就会自动地挂载到子组件的根元素上面 -->
      <h2>属性透传</h2>
      <child aaa="3" bbb="4"></child>
    </div>

    <script src="./vue.js"></script>
    <script>
      const Child = {
        props: ["aaa"],
        template: `
          <div>这是child子组件 - {{ aaa }}</div>
        `,
      };
      Vue.createApp({
        data() {
          return {};
        },
        components: {
          Child,
        },
      }).mount("#app");
    </script>
  </body>
</html>
